#include<bits/stdc++.h>

using namespace std;

int main() {
    int a[] = {1, 6, 2, 5, 1, 2, 3,};
    int n = sizeof(a) / sizeof(a[0]);
    int b[10] = {0};
    for (int i = 0; i < n; i++) {
        b[a[i]]++;
    }
//	copy(b,b+10,ostream_iterator<int>(cout," "));
    for (int i = 0; i < 10; i++) {
        if (b[i])cout << i << " ";
    }
    return 0;
}
